
package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.DeviceDto;
import com.zzyl.dto.DevicePageQueryDto;
import com.zzyl.entity.Device;
import com.zzyl.vo.retreat.DeviceVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface DeviceMapper {

    @Select("select count(*) from device where device_name=#{deviceName}")
    int getdeviceByName(String deviceName);

    void inseret(Device device);

    Page<DeviceVo> pageQueryDevice(DevicePageQueryDto devicePageQuery);


    DeviceVo queryDeviceDetail(String iotId);

    void updateDevice(DeviceDto deviceDto);
    @Delete("delete from device where iot_id=#{iotId}")
    void deleteDevice(String iotId);

    List<Long> selectNursingIdsByIotIdWithElder(String managerRole);

    List<Long> selectNursingIdsByIotIdWithBed(String managerRole);
}

